]> dgit.raspbian.org Git - gnome-shell.git/log
gnome-shell.git
7 years agoappIcon: Make AppIcon a drop target
Georges Basile Stavracas Neto [Fri, 12 Jul 2019 22:32:54 +0000 (19:32 -0300)]
appIcon: Make AppIcon a drop target

Because the Dash icons are not drop targets themselves,
add a tiny DashIcon class, which is an AppDisplay.AppIcon
subclass, and disable all DND drop code from it.

Show a folder preview when dragging an app icon over another
app icon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/671

7 years agoappIcon: Scale and fade itself when starting drag
Georges Basile Stavracas Neto [Thu, 4 Jul 2019 21:39:13 +0000 (18:39 -0300)]
appIcon: Scale and fade itself when starting drag

As per design direction, scale and fade the app icon
when starting dragging it, and show it again if the
drop is accepted. Clutter takes care of animating the
rest of icon positions through implicit animations.

Scale and fade the dragged icon while it's being dragged.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/671

7 years agosearch: Defer updating results on allocation changes until redraw
Jonas Dreßler [Wed, 7 Aug 2019 15:39:25 +0000 (17:39 +0200)]
search: Defer updating results on allocation changes until redraw

Since the `notify::allocation` signal will obviously get emitted while
the actor is inside an allocation cycle and we might end up doing
changes to its allocation inside `updateSearch` by hiding or showing the
actor (which queues a relayout), we get a warning from Clutter.

Fix this by delaying the call to the parent method until the next
redraw, which should happen a few moments after the current relayout.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/672

7 years agosearch: Don't use max number of results if allocation width is 0
Jonas Dreßler [Wed, 7 Aug 2019 14:42:17 +0000 (16:42 +0200)]
search: Don't use max number of results if allocation width is 0

Since commit 1a27ff6130e03e64d9e426ece72a12e4e2a80f50 we use the
allocation width of the GridSearchResults actor to calculate the max
number of results that can be shown for this search provider.

On the first run of the search, when no previous (cached) allocation is
available for the actor of GridSearchResults, the allocation width used
in `_getMaxDisplayedResults` will be 0, which in turn will make
`updateSearch` filter out all results returned by the search provider.

Now if this search provider is the only search provider that's enabled,
after calling `updateSearch`, the `SearchResults` class will call
`_updateSearchProgress` to check if any results are visible, assume
nothing was found and therefore hide the scrollView. This in turn causes
the GridSearchResults actor to not get a new allocation, which prevents
our code to fixup the max number of results on `notify::allocation` from
working: The number will continue to be 0 and we'll never show any
results.

To fix this regression, return -1 in `_getMaxDisplayedResults` if the
allocation width is 0 to inform `updateSearch` that we can't calculate
the maximum number yet and interpret a return value of -1 as "show all
results" in `updateSearch`. The same problem would probably also appear
if the allocation width is anything between 0 and the width of the
iconGrid with one icon in it, although this might as well be a valid
width in case a very small screen is used or with very large icons. So
let's only check for a width of 0 and hope the GridSearchResults actor
won't get weird temporary allocations in that range.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/672

7 years agoappDisplay: Animate activate-discrete-gpu action in the AppIconMenu
Jonas Dreßler [Thu, 8 Aug 2019 16:15:32 +0000 (18:15 +0200)]
appDisplay: Animate activate-discrete-gpu action in the AppIconMenu

Just as we animate the apps launch using the zoom out animation if the
'new-window' action provided by the app is launched, we should also show
this animation if the 'activate-discrete-gpu' action provided by the app
via its AppInfo is launched.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/673

7 years agoappDisplay: Always animate our own new window and discrete gpu actions
Jonas Dreßler [Thu, 8 Aug 2019 15:27:40 +0000 (17:27 +0200)]
appDisplay: Always animate our own new window and discrete gpu actions

For the "New Window" entry we add to the AppIcons popup menu we should
always animate the app icon if the menu entry is activated as it was
intended by commit 62786c09a8.

For the "Launch using Dedicated Graphics Card" entry we can also always
show the animation if the entry is activated since the entry should only
be visible if the app is stopped.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/673

7 years agoutil: Remove AppSettingsMonitor
Florian Müllner [Thu, 1 Aug 2019 14:24:59 +0000 (16:24 +0200)]
util: Remove AppSettingsMonitor

It is now unused.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1158

7 years agodateMenu: Stop accessing app settings directly
Florian Müllner [Wed, 31 Jul 2019 23:24:13 +0000 (01:24 +0200)]
dateMenu: Stop accessing app settings directly

Clocks has exactly the same issue as Weather: Its integration currently
relies on accessing its settings directly, which isn't possible when
the app is sandboxed.

Fix this the same way we did for Weather, by adding our own setting
and syncing it with the app via a custom D-Bus interface.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1158

7 years agoappDisplay: Animate launch of new-window action in the AppIconMenu
Jonas Dreßler [Fri, 2 Aug 2019 12:23:13 +0000 (14:23 +0200)]
appDisplay: Animate launch of new-window action in the AppIconMenu

We add our own "New Window" menu entry if the app doesn't already
provide a 'new-window' action. For this menu entry, we show the zoom out
animation on the app icon when the user clicks the entry.

To be consistent in case the app already provides its own 'new-window'
action via its AppInfo, also show the zoom out animation when this
action is activated.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/662

7 years agoshell/app-system: Monitor for icon theme changes
Georges Basile Stavracas Neto [Thu, 1 Aug 2019 23:58:20 +0000 (20:58 -0300)]
shell/app-system: Monitor for icon theme changes

Whenever an app is installed, the usual routine is
to run 'gtk-update-icon-cache' after installing all
of the app's files.

The side effect of that is that the .desktop file of
the application is installed before the icon theme
is updated. By the time GAppInfoMonitor emits the
'changed' signal, the icon theme is not yet updated,
leading to StIcon use the fallback icon.

Under some circumstances (e.g. on very slow spinning
disks) the app icon is never actually loaded, and we
see the fallback icon forever.

Monitor the icon theme for changes when an app is
installed. Try as many as 6 times before giving up
on detecting an icon theme update.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/661

7 years agost/texture-cache: Monitor GtkIconTheme changes
Georges Basile Stavracas Neto [Thu, 1 Aug 2019 23:54:42 +0000 (20:54 -0300)]
st/texture-cache: Monitor GtkIconTheme changes

The texture cache, right now, only monitors for
complete theme changes. If the contents of the
icon theme change, however, the texture cache
isn't properly invalidated.

This manifests itself as a randomly reproducible
bug when installing an app; the app icon may be
the fallback forever, or as long as something else
updates the icon theme.

Watch for the GtkIconTheme:changed signal, and
evict the texture cache when the theme changes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/661

7 years agocontrolsManager: Don't fade icon grid while dragging
Georges Basile Stavracas Neto [Wed, 3 Jul 2019 17:53:09 +0000 (14:53 -0300)]
controlsManager: Don't fade icon grid while dragging

As pointed out by designers, fading it signals that the
icon grid is not a drop target, when now it actually is.

Remove the fade effect applied to the icon grid when
dragging. Since this is the only caller of fadeIn() and
fadeHalf(), also remove these methods.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/664

7 years agoallView: Scale in when moving icons from folders
Georges Basile Stavracas Neto [Sat, 29 Jun 2019 17:09:32 +0000 (14:09 -0300)]
allView: Scale in when moving icons from folders

App icons inside folders are already animated when the folder is
opened, but moving an app icon from a folder doesn't, making the
transition abrupt.

Fortunately, it's easy to detect icons that were previously hidden
but are not anymore.

Add an animation to these icons when showing.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/664

7 years agofolderIcon: Add visual drag-over feedback
Georges Basile Stavracas Neto [Tue, 2 Jul 2019 00:37:35 +0000 (21:37 -0300)]
folderIcon: Add visual drag-over feedback

WIP: This is not exactly what was discussed on IRC, but
it's looking alright as a first iteration. Design feedback
welcomed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/664

7 years agoallView: Remove icon from folder when dropping outside
Georges Basile Stavracas Neto [Sat, 29 Jun 2019 04:26:08 +0000 (01:26 -0300)]
allView: Remove icon from folder when dropping outside

When dropping an app icon to outside the folder, remove the
app from that folder. GNOME Shell is already smart enough
to figure out the setting changes and update the icons.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/664

7 years agoallView: Switch pages when dragging above or below the grid
Georges Basile Stavracas Neto [Fri, 28 Jun 2019 23:48:22 +0000 (20:48 -0300)]
allView: Switch pages when dragging above or below the grid

This is necessary for being able to drag application icons
to folders in different pages.

Add a drag motion handler to AllView and handle overshoots
when dragging. Only handle it when dragging from AllView.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/664

7 years agofolderIcon: Update folder icon after dropping
Georges Basile Stavracas Neto [Fri, 28 Jun 2019 22:49:18 +0000 (19:49 -0300)]
folderIcon: Update folder icon after dropping

After dropping an application into the folder icon, the
list of applications is updated but the folder icon itself
is not.

Introduce BaseIcon.update() and call it from FolderIcon
when redisplaying.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/664

7 years agofolderIcon: Allow dropping application icons
Georges Basile Stavracas Neto [Fri, 28 Jun 2019 22:47:32 +0000 (19:47 -0300)]
folderIcon: Allow dropping application icons

Connect to the overview signals related to Drag n' Drop, and
allow dropping application icons in it. Dropping an icon
appends the application id to the folder's GSettings key.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/664

7 years agoappDisplay: Add event blocker inhibition API
Georges Basile Stavracas Neto [Fri, 28 Jun 2019 22:44:20 +0000 (19:44 -0300)]
appDisplay: Add event blocker inhibition API

The event blocker is an actor that is added in between the
icon grid and the app folder popup in order to guarantee
that clicking outside the app folder will collapse it.

However, the next patch will require allowing dragging events
to be passed to folder icons, and the event blocker gets in
our way here, preventing drag n' drop to work properly.

Add an API to inhibit the event blocker. This API will be
used by the app folders while an item is dragged.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/664

7 years agosystemActions: Create SensorProxy unconditionally
Florian Müllner [Sat, 15 Jun 2019 14:31:53 +0000 (16:31 +0200)]
systemActions: Create SensorProxy unconditionally

When plugging in a device with sensors that are unsupported by
iio-sensor-proxy, the proxy may quit so fast that the name disappears
from the bus before we get to construct the SensorProxy in response
to the name-appeared handler, resulting in the following warning:

JS ERROR: TypeError: this._sensorProxy is null
_sensorProxyAppeared/this._sensorProxy<@resource:///org/gnome/shell/misc/systemActions.js:217:17
_makeProxyWrapper/</<@resource:///org/gnome/gjs/modules/overrides/Gio.js:243:21

Address this by creating the proxy unconditionally instead of monitoring
the bus name, and using the g-name-owner property to determine whether
iio-sensor-proxy is active.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1357

7 years agoworkspace: Sort windows to minimize travel distance
Sergey Bugaev [Sat, 20 Oct 2018 13:28:05 +0000 (16:28 +0300)]
workspace: Sort windows to minimize travel distance

When transitioning to or from the overview, windows travel
a certain distance between their real desktop position and
their place in the overview window grid. The less this travel
distance is, the smoother, more polished, and less jarring
the overall transition looks. This is why it makes sense to
try reordering and repositioning windows to minimize their
travel distance. That being said, there are other factors
that impact the quality of the overview layout, such as how
much the windows get scaled and what portion of the overall
available space they take up.

The existing code tries to minimize the travel distance by
sorting the windows in each row by their horizontal position.
There are, however, two problems with this implementation.
First, it compares the coordinates of windows' left edges as
opposed to their centers, which means it yields unexpected
results when a small window is positioned next to the left
edge of a large window. Second, it completely disregards
vertical coordinates, instead assigning windows to the grid
rows using their monotonically increasing window numbers,
effectively vertically sorting them by the order they were
created in.

This commit changes both vertical and horizontal ordering
to work based on the coordinates of the geometric centers
of the windows. That is to say, windows are first assigned
to grid rows based on the vertical coordinates of their
centers, and subsequently sorted inside each row based on
the horizontal coordinates of said centers. In my testing,
this leads to a much more intuitive and visually pleasing
window placement.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/267

7 years agoweather: Pick up original settings values
Florian Müllner [Thu, 1 Aug 2019 13:18:43 +0000 (13:18 +0000)]
weather: Pick up original settings values

We mirror Weather's location settings to not depend on the app running,
but then don't read the original values, oops.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1158

7 years agoweather: Fix warning on closing Weather
Florian Müllner [Wed, 31 Jul 2019 23:24:13 +0000 (01:24 +0200)]
weather: Fix warning on closing Weather

GDBusProxy::g-properties-changed is also emitted when the name drops from
the bus, at which point any properties will be null. That's not a valid
gsettings value, so to avoid the corresponding warning, move the g-name-owner
check accordingly.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1158

7 years agodocs: Update animation section
Florian Müllner [Sat, 21 Jul 2018 01:18:29 +0000 (03:18 +0200)]
docs: Update animation section

Replace the existing Tweener section with a small outline of the
Clutter animation API and our wrappers.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/669

7 years agolookingGlass: Remove Tweener from preimported modules
Florian Müllner [Fri, 20 Jul 2018 22:01:37 +0000 (00:01 +0200)]
lookingGlass: Remove Tweener from preimported modules

We want to encourage using Clutter's implicit animations directly,
so stop importing the discouraged animation framework by default.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/669

7 years agokeybindings: Remove pause-resume-tweens shortcut
Florian Müllner [Sat, 21 Jul 2018 03:49:20 +0000 (05:49 +0200)]
keybindings: Remove pause-resume-tweens shortcut

It is no longer useful since we replaced Tweener.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/669

7 years agodnd: Stop using getTweenCount()
Florian Müllner [Sat, 21 Jul 2018 22:46:05 +0000 (00:46 +0200)]
dnd: Stop using getTweenCount()

Those checks were carried over from the very first DND implementation;
if they were ever actually required at all, this is no longer the case
as we moved away from Tweener for all our animations.

The number of cases where an extension is still using Tweener, creates
draggable actors, *AND* requires the checks for proper functioning
should be indistinguishable from zero, so drop the code.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/669

7 years agojs: Use Clutter transitions for adjustment changes
Florian Müllner [Wed, 24 Jul 2019 19:03:17 +0000 (21:03 +0200)]
js: Use Clutter transitions for adjustment changes

This concludes our quest of moving from Tweener to Clutter's
animation framework.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/669

7 years agoenvironment: Add convenience method for adjustment transitions
Florian Müllner [Thu, 25 Jul 2019 14:21:46 +0000 (16:21 +0200)]
environment: Add convenience method for adjustment transitions

By now, Tweener is used exclusively to animate changes to the
StAdjustment:value property. But not for long, as now that we
implement the same transition API as Clutter.Actor, we can
re-use the existing convenience method for property transitions
for adjustment changes as well.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/669

7 years agost: Use StAdjustment's new transition API
Florian Müllner [Fri, 2 Aug 2019 15:04:42 +0000 (17:04 +0200)]
st: Use StAdjustment's new transition API

Now that the adjustment itself can be used to track its transitions,
do that for animating the scroll bar handle.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/669

7 years agost: Add transition API to StAdjustment
Florian Müllner [Fri, 2 Aug 2019 14:58:39 +0000 (16:58 +0200)]
st: Add transition API to StAdjustment

StAdjustment implements the ClutterAnimatable interface, so we can
already animate its properties with ClutterPropertyTransitions.

But as it is currently not possible to associate a transition with
an adjustment, it must be owned (and kept alive in case of GC) by
the calling code.

Change that by implementing the same (add|remove|get)_transition() API
as ClutterActor, so we can use a familiar API and even duck typing in
case of javascript.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/669

7 years agovolume: Fix overdrive in slider
Florian Müllner [Wed, 7 Aug 2019 12:55:49 +0000 (14:55 +0200)]
volume: Fix overdrive in slider

When setting a maximum value above 1, we currently set a non-existant
maximum_level property instead of the actual 'maximum-value' one.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/670

7 years agobarLevel: Fix value range
Florian Müllner [Wed, 7 Aug 2019 12:33:08 +0000 (14:33 +0200)]
barLevel: Fix value range

The range is usually within [0, 1], but since we support overdrive
as well, the upper limit must be the maximum value we allow for
overdrive.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/670

7 years agoenvironment: Remove transition tracking
Florian Müllner [Wed, 7 Aug 2019 00:28:40 +0000 (02:28 +0200)]
environment: Remove transition tracking

The tracking was important in an earlier iteration, but as the helper
functions now remove overwritten transitions before setting up the
new ones, we can just as well connect to the ::stopped signal directly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/668

7 years agoenvironment: Fix transition callback
Florian Müllner [Wed, 7 Aug 2019 00:26:32 +0000 (02:26 +0200)]
environment: Fix transition callback

This is rather embarrassing - we currently confuse the transition with
the finished parameter, which means we always run the onComplete handler
no matter whether the transition was interrupted or actually completed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/668

7 years agoallView: Always update currentPage
Georges Basile Stavracas Neto [Tue, 6 Aug 2019 22:41:54 +0000 (19:41 -0300)]
allView: Always update currentPage

Commit 0f178c3b3dcfe added a shortcirtuit to avoid running
an animation on an invisible actor. However, it introduced
a bug where the current page is not properly updated. That
leads to the wrong set of icons being animated under some
circumstances.

Update the current page even if we bail out early.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/667

7 years agojs: Ease non-animatable actor properties
Florian Müllner [Thu, 25 Jul 2019 00:06:05 +0000 (02:06 +0200)]
js: Ease non-animatable actor properties

Properties that aren't marked as animatable don't support *implicit*
animations, but they can still be animated with explicit transitions.
Use the newly added convenience method to cut down further on Tweener
usage.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/666

7 years agoenvironment: Add convenience method for property transitions
Florian Müllner [Sat, 10 Jun 2017 02:14:12 +0000 (04:14 +0200)]
environment: Add convenience method for property transitions

While we are now using implicit animations for all animatable properties,
there are still some cases where we animate other actor properties (for
example from a custom subclass) or associated objects like effects.

Those can still be animated using Clutter animations, as long as we use
the explicit API rather than implicit animations. Again this API is
cumbersome and tricky enough to warrant a convenience wrapper.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/666

7 years agojs: Use GObject properties for animated properties
Florian Müllner [Thu, 25 Jul 2019 22:13:19 +0000 (22:13 +0000)]
js: Use GObject properties for animated properties

Clutter animations work on GObject properties on animatables. The
last commit took care of the latter by turning all animated objects
into actor subclasses, now it's time to make all properties used
in Tweens into GObject properties.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/666

7 years agojs: Actorize animated objects
Florian Müllner [Thu, 25 Jul 2019 16:53:00 +0000 (18:53 +0200)]
js: Actorize animated objects

We have a couple of places where we don't tween the actor, but a
custom property on the delegate object. In order to move those
to Clutter animations, we will need an animatable, so turn those
objects into widget subclasses.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/666

7 years agowindowManager: Change effect's brightness property
Florian Müllner [Sun, 22 Jul 2018 01:31:54 +0000 (03:31 +0200)]
windowManager: Change effect's brightness property

The set_brightness() method is the most convenient way of controlling
the effect's brightness, but Clutter animations only deal with properties,
so start using the (ClutterColor) brightness property instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/666

7 years agowindowManager: Move animation into WindowDimmer
Florian Müllner [Sun, 22 Jul 2018 01:31:54 +0000 (03:31 +0200)]
windowManager: Move animation into WindowDimmer

Currently WindowDimmer exposes a JS property that is used to control the
underlying effect. This works fine with Tweener, but not with Clutter
animations which we want to use ultimately.

As a first step towards that, expose a setDimmed() method instead of
the property and handle the animation internally, so it can be adapted
more easily.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/666

7 years agojs: Use implicit animations for animatable properties
Florian Müllner [Fri, 20 Jul 2018 19:46:19 +0000 (21:46 +0200)]
js: Use implicit animations for animatable properties

We now have everything in place to replace Tweener for all animatable
properties with implicit animations, which has the following benefits:

 - they run entirely in C, while Tweener requires context switches
   to JS each frame

 - they are more reliable, as Tweener only detects when an animation
   is overwritten with another Tween, while Clutter considers any
   property change

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

7 years agoenvironment: Add convenience method for implicit animations
Florian Müllner [Sat, 10 Jun 2017 00:52:12 +0000 (02:52 +0200)]
environment: Add convenience method for implicit animations

Setting up implicit animations is more verbose than using tweener, in
particular when setting up a callbacks to run on overwrite or completion.
In order to make its use more convenient, monkey-patch ClutterActor
with an ease() method that works similarly to Tweener.addTween().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

7 years agoenvironment: Support slow down factor when easing
Florian Müllner [Wed, 4 Jun 2014 22:13:14 +0000 (00:13 +0200)]
environment: Support slow down factor when easing

Being able to slow down animations is a helpful debugging tool; to not
lose it when starting to use Clutter's implicit animations, monkey-patch
the appropriate methods to support our global slow down factor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

7 years agotweener: Use new adjustAnimationTime() helper
Florian Müllner [Thu, 25 Jul 2019 10:24:50 +0000 (12:24 +0200)]
tweener: Use new adjustAnimationTime() helper

Now that we have a new helper function for adjusting animation times,
make Tweener use it so that we keep the code in a single place.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

7 years agoenvironment: Add adjustAnimationTime() helper
Florian Müllner [Wed, 4 Jun 2014 22:13:14 +0000 (00:13 +0200)]
environment: Add adjustAnimationTime() helper

As we currently use Tweener for all animations, we have a single place
for hooking up the enable-animations and slow-down-factor settings.
However that will no longer hold true when we'll start to use Clutter's
built-in animation facilities, so add a small helper function that
applies the necessary adjustments.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

7 years agomessageTray: Stop tweening custom opacity property
Florian Müllner [Fri, 20 Jul 2018 19:46:19 +0000 (21:46 +0200)]
messageTray: Stop tweening custom opacity property

Notifications use a transition that overshoots the target value, however
we can only really do that for the position and not the opacity where
some values would end up out of the valid range.

We currently address this by proxying the actual opacity property in a
javascript property, and clamp it to the valid range in an onUpdate()
callback.

This won't be an option if we want to use Clutter animations, so instead,
use separate tweens for opacity and position.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

7 years agopageIndicators: Defer IN animation until redraw
Florian Müllner [Sun, 4 Aug 2019 23:02:38 +0000 (01:02 +0200)]
pageIndicators: Defer IN animation until redraw

Unlike Tweener, which doesn't know or care about actor state, Clutter
will skip implicit animations on actors that aren't mapped. This makes
sense of course, but it will break the page indicator animation we
do on map: When we get notified about the container being mapped, the
individual indicators (which are the actors being animated) are still
unmapped.

Resolve this by deferring the animation to a LaterFunc.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

7 years agoscreenShield: Stop using custom transition
Florian Müllner [Fri, 26 Jul 2019 00:38:49 +0000 (02:38 +0200)]
screenShield: Stop using custom transition

For animating the arrows on the screenshield, we currently use a custom
transition function that tweens the opacity from 0 to maxOpacity in the
first half of the animation, and from maxOpacity back to 0 in the second
half.

This doesn't easily translate to Clutter's own animation framework, so
replace the custom transition with two consecutive tweens which do.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

7 years agodash: Directly tween actors
Florian Müllner [Sat, 21 Jul 2018 05:08:33 +0000 (07:08 +0200)]
dash: Directly tween actors

Dash items are currently animated via the custom "childScale" and
"childOpacity" properties. However since commit efb3025d8cdb, those
properties actually control the scale-x/scale-y and opacity properties
of the actor itself (not the child), so cut out the intermediate
custom properties in favor of the "real" ones.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

7 years agoripple: Split animation
Florian Müllner [Sat, 10 Jun 2017 03:55:10 +0000 (05:55 +0200)]
ripple: Split animation

Similar to the previous patch, splitting the existing tween into two
will allow us to use implicit animations.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

7 years agopopupMenu: Split submenu expansion and arrow rotation
Florian Müllner [Sat, 10 Jun 2017 02:32:22 +0000 (04:32 +0200)]
popupMenu: Split submenu expansion and arrow rotation

When expanding a submenu, we currently use a single tween to animate
both the submenu actor and the source arrow. We do this by tweening
a monkey-patched JS property on the main actor, which we then use
to update the arrow's GObject property on updates. As Clutter cannot
animate random JS properties, this trick will prevent us from using
implicit animations here.

The only reason I can think of for using a single tween is to keep
both animations in perfect lock step, but as expansion and rotation
are visually quite distinct, this shouldn't be required, so just
set up separate animations for each actor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

7 years agoshell-app: Consider desktop actions in can_open_new_window()
Florian Müllner [Tue, 6 Aug 2019 11:19:59 +0000 (13:19 +0200)]
shell-app: Consider desktop actions in can_open_new_window()

We currently only consider a remote "app.new-window" action when running,
but not a fixed "new-window" action in the .desktop file. The latter is
clearly useful as well, in particular as open_new_window() already does,
so add it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/665

7 years agomessageTray: Drop tween helper function
Florian Müllner [Fri, 20 Jul 2018 19:46:19 +0000 (21:46 +0200)]
messageTray: Drop tween helper function

It makes the code harder to follow and saves little in terms of code
duplication.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/654

7 years agowindowManager: Small cleanup
Florian Müllner [Sun, 22 Jul 2018 01:31:54 +0000 (03:31 +0200)]
windowManager: Small cleanup

We start with a dim factor of 0, so the syncEnabled() call in the
constructor will always disable the effect. Just create the effect
disabled and save the method call.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/654

7 years agobarLevel: Don't reset value on overview-start changes
Florian Müllner [Thu, 25 Jul 2019 15:59:01 +0000 (15:59 +0000)]
barLevel: Don't reset value on overview-start changes

While it makes sense to cap the current value to a new maximum value,
I can't think of a good reason why changing the overdrive-start should
reset the current value to that.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/654

7 years agologinDialog: Use GObject bindings over onUpdate handler
Florian Müllner [Fri, 26 Jul 2019 01:13:59 +0000 (01:13 +0000)]
loginDialog: Use GObject bindings over onUpdate handler

Instead of iterating over all actors each frame and sync'ing their
opacities, we can set up bindings once before the animation.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/654

7 years agopointerA11yTimeout: Use notify handler instead of onUpdate callback
Florian Müllner [Fri, 26 Jul 2019 00:28:40 +0000 (02:28 +0200)]
pointerA11yTimeout: Use notify handler instead of onUpdate callback

We either need to queue a repaint on opacity updates or we don't,
whether the opacity change happens in an animation or not shouldn't
matter.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/654

7 years agopointerA11yTimeout: Fix style nit
Florian Müllner [Fri, 26 Jul 2019 00:25:32 +0000 (02:25 +0200)]
pointerA11yTimeout: Fix style nit

There's a stray space after the opening parentheses. While at it,
reindent the object literal.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/654

7 years agoswitcherPopup: Avoid unnecessary animation
Florian Müllner [Sat, 21 Jul 2018 03:20:35 +0000 (05:20 +0200)]
switcherPopup: Avoid unnecessary animation

Ever since commit 28bb0c1fb2, the popup's actual visibility has been
controlled by its :opacity property, not :visible.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/654

7 years agoappDisplay: Skip animation when hidden
Florian Müllner [Fri, 26 Jul 2019 01:04:38 +0000 (01:04 +0000)]
appDisplay: Skip animation when hidden

The time computation isn't just unnecessary in that case, it's likely
wrong as well: If we don't have a valid allocation, we may well end
up with a negative value, NaN or Infinity.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/654

7 years agoUpdate Indonesian translation
Kukuh Syafaat [Tue, 6 Aug 2019 10:49:56 +0000 (10:49 +0000)]
Update Indonesian translation

7 years agoallView: Redisplay on folder changes
Georges Basile Stavracas Neto [Tue, 2 Jul 2019 16:33:07 +0000 (13:33 -0300)]
allView: Redisplay on folder changes

Now that redisplaying is a lightweight operation that only
adds and removes what changed, we can not be concerned about
redisplaying on folder changes.

Redisplaying will be necessary when custom order in the app
grid is implemented, in order to update not only which icons
are hidden, but also their position.

Call _redisplay() in AllView when folders change.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

7 years agobaseAppView: Remove unused BaseAppView.addItem
Georges Basile Stavracas Neto [Tue, 2 Jul 2019 13:12:08 +0000 (10:12 -0300)]
baseAppView: Remove unused BaseAppView.addItem

Now that BaseAppView does not allow for subclasses to add
and remove items directly, the addItem() method can be
removed.

Remove BaseAppView.addItem().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

7 years agoallView, folderView: Only add icons once
Georges Basile Stavracas Neto [Tue, 30 Jul 2019 15:15:51 +0000 (12:15 -0300)]
allView, folderView: Only add icons once

FolderView and AllView currently check if the item is
present in the BaseAppView._items map, in order to avoid
adding the same icon multiple times.

Now that BaseAppView._loadApps() has a different role --
it returns a list with all app icons, and BaseAppView
diffs with the current list of app icons -- checking the
BaseAppView._items map is wrong.

Make sure there are no duplicated items in the temporary
array returned by all _loadApps() implementations. Remove
the now unused BaseAppView.hasItem() method.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

7 years agobaseAppView: Only add and remove when necessary
Georges Basile Stavracas Neto [Tue, 2 Jul 2019 02:13:07 +0000 (23:13 -0300)]
baseAppView: Only add and remove when necessary

BaseAppView currently removes all icons, and readds them, every
time the list of app icons needs to be redisplayed. In order to
allow animating app icon positions in the future, however, we
cannot destroy the actors of the app icons.

Previous commits paved the way for us to do differential loading,
i.e. add only the icons that were added, and remove only what was
removed.

Make the BaseAppView effectively implement differential loading.
The BaseAppView.removeAll() method is removed, since we do not
remove all icons anymore. BaseAppView._loadApps() now returns an
array with the new apps, instead of putting them directly at the
BaseAppView lists.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

7 years agobaseAppView: Move _loadGrid() into _redisplay()
Georges Basile Stavracas Neto [Tue, 2 Jul 2019 02:01:59 +0000 (23:01 -0300)]
baseAppView: Move _loadGrid() into _redisplay()

Next commit will introduce differential loading of
app icons, and will reorganize this part of the
codebase.

When doing that, the ideal symmetry of the new code
would be:

 * Update BaseAppView._allItems array
 * Update BaseAppView._items map
 * Update BaseAppView._grid actor

Move the code in _loadGrid() into _redisplay() so that
we can check in-place which new icons need to be added.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

7 years agobaseAppView: Call loadGrid() directly
Georges Basile Stavracas Neto [Sat, 29 Jun 2019 16:22:08 +0000 (13:22 -0300)]
baseAppView: Call loadGrid() directly

Now that the three views follow the exact same loading routine
(remove all + load apps + load grid), we don't need each view
call loadGrid() directly anymore.

This is an important step in order to animate adding and removing
icons, since now we can diff old and new app icons properly.

Move all calls to BaseAppView.loadGrid() to a single one after
BaseAppView._loadApps(). Also add the underscore prefix, since
this is now considered a protected function.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

7 years agofrequentView: Use BaseAppView.addItem() and loadGrid()
Georges Basile Stavracas Neto [Sat, 29 Jun 2019 16:15:20 +0000 (13:15 -0300)]
frequentView: Use BaseAppView.addItem() and loadGrid()

FrequentView is another view that is slightly not unified with how
BaseAppView expects subclasses to load app icons. Instead of using
BaseAppView.addItem() and then calling BaseAppview.loadGrid(), it
adds the app icons directly to the icon grid.

Make FrequentView add icons using BaseAppview.addItem(), and load
the icons using BaseAppView.loadGrid().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

7 years agofolderIcon: Move app icon loading to FolderView
Georges Basile Stavracas Neto [Sat, 29 Jun 2019 15:58:26 +0000 (12:58 -0300)]
folderIcon: Move app icon loading to FolderView

Future patches will diff the old and new icons of views, in order to
animate them when necessary (e.g. adding an app icon to a folder, or
from a folder back to the app grid). In order to do that, all views
must be streamlined in how they load app icons.

Currently, FrequentView and AllView are already following the behavior
expected by BaseAppView, but FolderView isn't. Its icons are loaded by
FolderIcon, and FolderView doesn't implement BaseView._loadApps(),
which makes it impossible to diff old and new apps.

Move the app icon loading routine from FolderIcon to FolderView, by
implementing the _loadApps() method.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

7 years agocleanup: Use milliseconds for animation times
Florian Müllner [Thu, 1 Aug 2019 23:13:10 +0000 (01:13 +0200)]
cleanup: Use milliseconds for animation times

The different units - seconds for Tweener and milliseconds for
timeouts - are not a big issue currently, as there is little
overlap. However this will change when we start using Clutter's
own animation framework (which uses milliseconds as well), in
particular where constants are shared between modules.

In order to prepare for the transition, define all animation times
as milliseconds and adjust them when passing them to Tweener.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/663

7 years agomeson: Avoid using relative paths to po directory
Benjamin Berg [Fri, 26 Apr 2019 10:33:58 +0000 (12:33 +0200)]
meson: Avoid using relative paths to po directory

Replace the relative path to the po directory with a toplevel definition
of po_dir and use that instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/507

7 years agodata: Update systemd units
Benjamin Berg [Fri, 19 Apr 2019 22:21:55 +0000 (00:21 +0200)]
data: Update systemd units

The existing units were never used as the corresponding support was
never merged into gnome-session.

This commits updates units to be usable with the newer gnome-session
unit definitions. Also added is appropriate failure/restart logic
including the ability to disable extensions. Note that extensions will
only be disabled if a failure happens in the first two minutes after
login.

https://gitlab.gnome.org/GNOME/gnome-session/merge_requests/13
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/507

7 years agodata: Flag in desktop file that gnome-shell can be started using systemd
Benjamin Berg [Mon, 5 Aug 2019 19:46:05 +0000 (21:46 +0200)]
data: Flag in desktop file that gnome-shell can be started using systemd

As gnome-shell is a required component for GNOME sessions, gnome-session
will currently always try to autostart it. However as we are moving towards
using systemd's user instance for session startup, gnome-session should only
be responsible for launching the shell when either not running under systemd
or when we were built without systemd support.

gnome-session can detect the former but not the latter, so communicate this
via the newly added X-GNOME-HiddenUnderSystemd key in the .desktop file.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/507
https://gitlab.gnome.org/GNOME/gnome-session/merge_requests/13

7 years agoUpdate Swedish translation
Anders Jonsson [Mon, 5 Aug 2019 20:41:06 +0000 (20:41 +0000)]
Update Swedish translation

7 years agoUpdate Romanian translation
Daniel Șerbănescu [Sun, 4 Aug 2019 13:09:14 +0000 (13:09 +0000)]
Update Romanian translation

7 years agoUpdated Spanish translation
Daniel Mustieles [Fri, 2 Aug 2019 07:14:52 +0000 (09:14 +0200)]
Updated Spanish translation

7 years agoUpdate Karbi translation
Jor Teron [Fri, 2 Aug 2019 07:12:56 +0000 (07:12 +0000)]
Update Karbi translation

7 years agost: Move slow-down-factor into settings
Florian Müllner [Thu, 25 Jul 2019 10:50:26 +0000 (12:50 +0200)]
st: Move slow-down-factor into settings

Now that we have a Settings singleton, we have a better place for the
slow-down-factor than an awkward extern variable.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/656

7 years agost: Fix property type
Florian Müllner [Thu, 1 Aug 2019 10:43:48 +0000 (12:43 +0200)]
st: Fix property type

Commit 8f3554ff accidentally changed the type of the StWidget:track-hover
property from boolean to object.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1482

7 years agoweather: Fix property name
Florian Müllner [Wed, 31 Jul 2019 23:46:05 +0000 (01:46 +0200)]
weather: Fix property name

It's g-*name*-owner. As the condition covers the unlikely case where
Weather is running before gnome-shell, this slipped through.

7 years agoci: Make eslint wrapper script usable outside gitlab's CI
Marco Trevisan (Treviño) [Wed, 31 Jul 2019 14:54:26 +0000 (16:54 +0200)]
ci: Make eslint wrapper script usable outside gitlab's CI

The eslint wrapper script is useful for development as well, but it currently
fails on systems where bash is not installed in /usr/bin.

Make it useful there as well by changing the shebang to use /usr/bin/env

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/655

7 years agoweather: Stop accessing app settings directly
Florian Müllner [Tue, 23 Jul 2019 10:49:40 +0000 (10:49 +0000)]
weather: Stop accessing app settings directly

Our current Weather integration depends on poking around the app's
settings, which we cannot do when the app is sandboxed (as its
filesystem is "hidden away" in a container in that case).

So instead, use our own GSettings schema for the settings, and sync
it with GNOME Weather via a custom D-Bus interface.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1158

7 years agost: Use g_object_notify_by_pspec()
Niels De Graef [Mon, 29 Jul 2019 15:59:41 +0000 (17:59 +0200)]
st: Use g_object_notify_by_pspec()

`g_object_notify()` actually takes a global lock to look up the property
by its name, which means there is a performance hit (albeit tiny) every
time this function is called. For this reason, always try to use
`g_object_notify_by_pspec()` instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/652

7 years agolightbox: Remove previously added tweens from target
Marco Trevisan (Treviño) [Wed, 31 Jul 2019 12:54:56 +0000 (14:54 +0200)]
lightbox: Remove previously added tweens from target

Since commit 007d30573 we use an actor effect to apply the radial effect and
we pass the effect to the tweener in order to animate it.

However, we always still remove the previously added tween from the actor,
instead that from the actual target.

So, depending the radial effect state, remove the tweens from the proper target

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/653

7 years agoEnsure G_PARAM_STATIC_STRINGS for all properties
Niels De Graef [Thu, 25 Jul 2019 17:34:19 +0000 (19:34 +0200)]
Ensure G_PARAM_STATIC_STRINGS for all properties

In `st`, we can do this by using `ST_PARAM_*`. In the other code files,
just use `G_PARAM_STATIC_STRINGS` directly.

This is just a minor convenience to prevent a few unnecessary string
copies.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/646

7 years agost: Cleanup ST_PARAM_* and add WRITABLE version
Niels De Graef [Sat, 27 Jul 2019 08:21:12 +0000 (10:21 +0200)]
st: Cleanup ST_PARAM_* and add WRITABLE version

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/646

7 years agouserWidget: Handle non-square icons gracefully
Florian Müllner [Wed, 10 Jul 2019 15:18:16 +0000 (17:18 +0200)]
userWidget: Handle non-square icons gracefully

We currently assume that user icons are square, which is the case when
set by the users settings panel, but not enforced by AccountsService.

Handle that case by moving the pixel size back to the actor and using
an appropriate background-size style property of 'cover' (which means
the smallest dimension of the image is scaled to fit the desired size).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1144

7 years agoshell: Actually make GLSLEffect an effect
Florian Müllner [Fri, 26 Jul 2019 20:08:52 +0000 (22:08 +0200)]
shell: Actually make GLSLEffect an effect

A generic, introspectable Shader effect is not only more flexible
than a shader actor, it will also make it much easier to turn
Lightbox into an actor subclass and replace Tweener with Clutter's
own animation support.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/651

7 years agoshell: Properly rename type
Florian Müllner [Fri, 26 Jul 2019 19:09:29 +0000 (21:09 +0200)]
shell: Properly rename type

This is just a find-and-replace name change to make the actual code
changes in the follow-up commit more apparent.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/651

7 years agoshell: Rename GLSLQuad to GLSLEffect
Florian Müllner [Fri, 26 Jul 2019 19:00:06 +0000 (21:00 +0200)]
shell: Rename GLSLQuad to GLSLEffect

You can guess where this is going ...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/651

7 years agolightbox: Remove unnecessary params
Florian Müllner [Fri, 26 Jul 2019 21:17:28 +0000 (23:17 +0200)]
lightbox: Remove unnecessary params

Actors have a default origin of (0, 0), so there's no need of
setting those explicitly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/651

7 years agotheme: Fix focus style of icons in the calendar popup
Jonas Dreßler [Sun, 28 Jul 2019 07:53:14 +0000 (09:53 +0200)]
theme: Fix focus style of icons in the calendar popup

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1474

7 years agoshellDBus: Use floats instead of percentages for OSD levels
Jonas Dreßler [Sat, 27 Jul 2019 17:29:36 +0000 (19:29 +0200)]
shellDBus: Use floats instead of percentages for OSD levels

Due to typecasting being done when converting floats to integers in
gnome-settings-daemon, a volume of 0.9% in g-s-d will end up as 0% in
gnome-shell. This can lead to a mismatch of icons between the volume OSD
(the icon to use is determined by g-s-d itself) and the shells own
volume indicator (the icon to use is determined by the shell using the
volume received from g-s-d).

To fix this, simply get rid of the conversion from float to percentage
in g-s-d and back to floats in the shell and just send a float/double
value on DBus.

https://gitlab.gnome.org/GNOME/gnome-settings-daemon/merge_requests/78
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/385

7 years agoosdWindow: Remove LevelBar and use BarLevel directly
verdre [Sat, 2 Feb 2019 16:58:47 +0000 (17:58 +0100)]
osdWindow: Remove LevelBar and use BarLevel directly

LevelBar is not really used, all the checks are implemented inside
BarLevel as well and the accessible name is wrong because the osdWindow
doesn't only show the volume, but also the brightness and other things.

The workaround for updating the bars width is also no longer needed now
that we have BarLevel.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/385

7 years agoosdWindow: Use float values as input for osdWindow
verdre [Sat, 2 Feb 2019 16:50:04 +0000 (17:50 +0100)]
osdWindow: Use float values as input for osdWindow

Using the same type/interval as BarLevel means we can cut out the intermediate
LevelBar class in a follow-up cleanup.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/385

7 years agobarLevel: Return when trying to set value to already used value
verdre [Sat, 2 Feb 2019 17:01:56 +0000 (18:01 +0100)]
barLevel: Return when trying to set value to already used value

There are some cases (for example when tweening value changes), where
the level will be set to the same value it already is at. Avoid those
unnecessary repaints by checking whether the value is already used and
returning if it is.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/385

7 years agobarLevel: Use setters instead of methods
Florian Müllner [Thu, 25 Jul 2019 15:33:00 +0000 (17:33 +0200)]
barLevel: Use setters instead of methods

Switching to getters/setters make the code suitable for using
with Tweener and as GObject properties, both of which we'll
do soon enough.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/385

7 years agovolume: Remove unused method
verdre [Sat, 2 Feb 2019 17:55:11 +0000 (18:55 +0100)]
volume: Remove unused method

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/385